function [ assoc_classifiers ] = assoc_frame_to_classifier( frames, labels, classifiers )
%ASSOC_FRAME_TO_CLASSIFIER Summary of this function goes here
%   Detailed explanation goes here

assoc_classifiers = {};
for i=1:length(classifiers)
    tmp_clsfr = classifiers(i);
    tmp_clsfr.frames = {};
    for j=1:length(tmp_clsfr.classes)
        tmp_cls = tmp_clsfr.classes{j};
        cls_id = 0;
        tmp_frms = [];
        for k = 1:length(tmp_cls)
            for l = 1:length(labels)
                if strcmp(tmp_cls{k}, labels{l}.class)
                    cls_id = l;
                    break;
                end
            end
            if cls_id
                idx = find(frames(3,:)==cls_id);
                tmp_frms = [tmp_frms idx];
            else
                warning(['Class ' tmp_cls{k} ' in classifier not found in training set.']);
            end
        end
        tmp_clsfr.frames{j} = tmp_frms;
    end
    assoc_classifiers{i} = tmp_clsfr;
end

end

